import 'package:flutter/cupertino.dart';
import 'package:xindong/common/xindong_sezhi.dart';
import 'package:xindong/common/xindong_define.dart';
import 'package:xindong/common/xindong_all.dart';

class XinDongCommonSelectItem extends StatelessWidget {
  final String title;
  final String value;
  final Function()? onTap;

  const XinDongCommonSelectItem({super.key, required this.title, required this.value, required this.onTap});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        color: DZColors.cellColor,
        padding: const EdgeInsets.only(left: kPaddingValue, right: kPaddingValue, top: 10, bottom: 10),
        margin: const EdgeInsets.only(bottom: 1),
        constraints: const BoxConstraints(minHeight: kCellHeight),
        child: Row(
          children: [
            Expanded(
              child: Text(
                title,
                style: const TextStyle(fontSize: 15, color: DZColors.titleColor, height: 1.2),
              ),
            ),
            Text(
              value,
              style: const TextStyle(fontSize: 14, color: DZColors.contentColor, height: 1.2),
            ),
            if (onTap != null) XinDongAll.instance.defaultIconNext,
          ],
        ),
      ),
    );
  }
}
